16. Challenge!
16 Challenge!
Sleeping a C++ program on a Linux based system:
- Include the “unistd” header file:
#include <unistd.h>
- Implement the usleep function which accepts an integer value denoting the time in microseconds:
usleep(microseconds);// usleep(5000000) pause for 5 seconds